<template>
  <div class="right-box-card">
    <div id="basic" style="margin:auto;">


      <!-- <div class="title">儿童膳食测评报告</div>
        <div id="createTime">报告日期：{{ report_time }}</div>
        <el-divider  border-style="dashed"  style="border-color:#2AB28B">
          <div class="subTitle">体成分分析</div>
        </el-divider>
        <div id="enerty">
          <div class="params">
            <div class="shu"></div>
            人体成分</div>
          <div id="analMan">
            <div id="imgMan"><img src="../../assets/img/analysis_man.png" style="width: 167px;height: 332px" alt=""></div>
            <div id="imgFat">脂肪 {{ info.Fat }} ({{ info.FatMin }}~{{ info.FatMax }})</div>
            <div id="imgBone">骨质 {{ info.Bone }} ({{ info.BoneMin }}~{{ info.BoneMax }})</div>
            <div id="imgProtein">蛋白质 {{ info.Protein }} ({{ info.ProteinMin }}~{{ info.ProteinMax }})</div>
            <div id="imgWater">水分 {{ info.Water }} ({{ info.WaterMin }}~{{ info.WaterMax }})</div>
          </div>
          <div id="right_1"><span class="right_content">体重：{{info.Weight}}</span>
            <div id="right_2"><span class="right_content">去脂体重：{{info.LBM}}</span>
              <div id="right_3"><span class="right_content">肌肉：{{info.Muscle}}</span>
                <div id="right_4"><span class="right_content">总水分：{{info.Water}}</span>
                  <div id="right_5"><span class="right_content">细胞内液：{{info.ICW}}</span>
                  </div>
                </div>
    
              </div>
            </div>
          </div>
          <div style="clear: both"></div>
          <div style="float: left;width: 60%">
            <div class="params Basic">
              <div class="shu"></div>
              基本评估</div>
            <div id="BasicAssessment">
              <ul>
                <li class="bt"><span>测评指标</span><span>状态</span><span>测评信息</span><span>正常范围</span></li>
                <li class="element" :class="[info.Weightcolor]"><span>体重</span><span>{{ info.Weightkeyword }}</span><span>{{info.Weight}}kg</span><span>{{info.WeightMin}}～{{info.WeightMax}}</span></li>
                <li class="element" :class="[info.Musclecolor]"><span>肌肉</span><span>{{ info.Musclekeyword }}</span><span>{{info.Muscle}}kg</span><span>{{info.MuscleMin}}～{{info.MuscleMax}}</span></li>
                <li class="element" :class="[info.PBFcolor]"><span>体脂百分比</span><span>{{ info.PBFkeyword }}</span><span>{{info.PBF}}%</span><span>{{info.PBFMin}}～{{info.PBFMax}}</span></li>
                <li class="element" :class="[info.Bonecolor]"><span>骨质</span><span>{{ info.Bonekeyword }}</span><span>{{info.Bone}}kg</span><span>{{info.BoneMin}}～{{info.BoneMax}}</span></li>
                <li class="element" :class="[info.Watercolor]"><span>水分</span><span>{{ info.Waterkeyword }}</span><span>{{info.Water}}%</span><span>{{info.WaterMin}}～{{info.WaterMax}}</span></li>
                <li class="element" :class="[info.SMMcolor]"><span>骨骼肌</span><span>{{ info.SMMkeyword }}</span><span>{{info.SMM}}kg</span><span>{{info.SMMMin}}～{{info.SMMMax}}</span></li>
                <li class="element" :class="[info.BMIcolor]"><span>体质指数</span><span>{{ info.BMIkeyword }}</span><span>{{info.BMI}}kg/m²</span><span>{{info.BMIMin}}～{{info.BMIMax}}</span></li>
                <li class="element" :class="[info.WHRcolor]"><span>腰臀比</span><span>{{ info.WHRkeyword }}</span><span>{{info.WHR}}kg</span><span>{{info.WHRMin}}～{{info.WHRMax}}</span></li>
              </ul>
            </div>
          </div>
          <div id="ObesityRight">
            <div class="params Basic">
              <div class="shu"></div>
              体重管理</div>
            <ul>
              <li><span class="weight_run">体重控制：</span><span class="weight_param">{{info.Weight_control}}kg</span></li>
              <li><span class="weight_run">脂肪控制量：</span><span class="weight_param">{{info.Fat_control}}kg</span></li>
              <li><span class="weight_run">肌肉控制量：</span><span class="weight_param">{{info.Muscle_control}}kg</span></li>
            </ul>
            <div class="params Basic" style="margin-top: 10%;margin-bottom: 3%">
              <div class="shu"></div>
              肥胖分析</div>
    
            <div id="Obesity" style="float: left;">
              <div id="ObesityFat">62%<br/>脂肪</div>
              <div id="ObesityProtein">38%<br/>蛋白质</div>
            </div>
    
            <div id="ObesityContent">
              <div><el-checkbox v-model="fatHigh">体脂：高</el-checkbox></div>
              <div><el-checkbox v-model="fatNormal">体脂：正常</el-checkbox></div>
              <div><el-checkbox v-model="fatLow">体脂：低</el-checkbox></div>
            </div>
    
    
            <div class="params Basic" style="margin-top: 10%;margin-bottom: 3%;">
              <div class="shu"></div>
              腰臀比</div>
            <div style="width: 80%;margin-left: 5%">
    
              <div  class="analysis_waist" ><img src="../../assets/img/analysis_waist_pear.png" style="width: 55px;height: 60px" alt=""><div class="waist"><el-checkbox v-model="WaistHigh">梨形</el-checkbox></div></div>
              <div  class="analysis_waist" ><img src="../../assets/img/analysis_waist_normal.png" style="width: 55px;height: 60px" alt=""><div class="waist"><el-checkbox v-model="WaistNormal">正常</el-checkbox></div></div>
              <div  class="analysis_waist" ><img src="../../assets/img/analysis_waist_apple.png" style="width: 55px;height: 60px" alt=""><div class="waist"><el-checkbox v-model="WaistLow">苹果形</el-checkbox></div></div>
    
            </div>
    
          </div>
        </div>
        <div style="clear: both"></div>
        <div class="params Basic" style="margin-top: 100px">
          <div class="shu"></div>
          内脏脂肪指数</div>
        <div>
          <div id='viscus' >
            <span>内脏脂肪指数：</span>
            <span class="ViscusNumber">{{info.VFI}}</span>
            <span class="ViscusLow" v-if="info.VFI < 6" >过低</span>
            <span class="ViscusLow" v-else-if="info.VFI > 6 && info.VFI <= 10" >正常</span>
            <span class="ViscusNormal" v-else-if="info.VFI > 10 && info.VFI <= 15">高</span>
            <span class="ViscusType" v-else>超高</span>
          </div>
    
          <div class="fen">
            <div class="fens">
            </div>
            <div class="fenss">
              <div class="one">正常</div>
              <div class="one">高</div>
              <div class="one">超高</div>
            </div>
            <div class="fenssNumber"><span class="six">6</span> <span>10</span><span>15</span><span>18</span></div>
          </div>
    
          <div style="clear: both"></div>
          <div class="params Basic" style="margin-bottom: 30px">
            <div class="shu"></div>
            水肿分析</div>
          <div>
              <span>
                <img src="../../assets/img/analysis_edema_round.png" style="width: 220px;height: 220px;float: left;padding-left:60px" alt="">
              <div class='Intracellular'>细胞内液<br/>{{info.ICW}}kg</div>
              <div class='ECF'>细胞外液<br/>{{info.ECW}}kg</div>
              <div class='other'>其他</div>
              <div class='BodyMoisture'>身体水分率：<span><br/>{{ info.Water }}%</span></div>
              </span>
            <div id="edema">水肿系数：<span>{{info.Edema}}</span>正常范围：「{{info.EdemaMin}}～{{info.EdemaMax}}」</div>
            <div id="edemaType"><span><el-checkbox v-model="EdemaHigh">干燥</el-checkbox></span><span><el-checkbox v-model="EdemaNormal">正常</el-checkbox></span><span><el-checkbox v-model="EdemaLow">浮肿</el-checkbox></span></div>
          </div>
    
    
        </div>
        <div style="clear: both"></div>
        <div class="params Basic" style="margin-bottom: 30px">
          <div class="shu"></div>
          营养分析</div>
        <div id="Nutritional">
          <div>蛋白质：<el-checkbox v-model="proteinHigh">不足</el-checkbox><el-checkbox v-model="proteinNormal">正常</el-checkbox><el-checkbox v-model="proteinLow">过量</el-checkbox></div>
          <div>脂　肪：<el-checkbox v-model="FatHigh">不足</el-checkbox><el-checkbox v-model="FatNormal">正常</el-checkbox><el-checkbox v-model="FatLow">过量</el-checkbox></div>
          <div>无机盐：<el-checkbox v-model="FatHigh">不足</el-checkbox><el-checkbox v-model="FatHighNormal">正常</el-checkbox><el-checkbox v-model="FatHigh">过量</el-checkbox></div>
          <div>基础代谢（BMR）：<span>{{info.BMR}}</span> kcal</div>
        </div> -->




      <!-- 体成分数据分析 -->

      <div style="">
        <div style=" width: 100%; background-color:#2ab28b;  text-align: center; margin:auto">
          <div style="font-size: 40px; font-weight: bold; color: #ffffff;padding-top:20px;">{{ Titlename }}</div>
          <!-- <span style="font-size: 30px; color: #666666; margin-left: 20px;display: block;">基本信息报告</span> -->
          <div style="margin-top:30px;font-size: 24px;padding-bottom: 20px;font-weight: bold;color:#333333;">儿童生长发育评估分析报告单
          </div>
        </div>
      </div>
      <!-- <div style=" page-break-after:inherit;"></div> -->
      <!-- 基本信息 -->
      <div style="width: 100%; height: 40px; background-color: #2AB28B; margin-top: 10px; display: flex;font-size: 14px;">
        <div><img src="../.././assets/img/12.jpg" style="height: 40px" alt="" /></div>
        <div style="font-size: 20px; margin-left: 10px; line-height: 40px; color: #fff;">儿童基本信息</div>
      </div>
      <div
        style="width: 1070px; border-top: 2px solid #09a578; border-right: 2px solid #09a578;  margin-top: 10px;font-size: 14px;"
        v-if="times == 2">
        <div style="display: flex">
          <div
            style="background-color: rgb(42, 178, 139); width: 10%;height: 40px;text-align: center;line-height: 40px;color: #fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            儿童姓名
          </div>
          <div
            style="width: 15%;height: 40px;text-align: center;line-height: 40px;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            {{ contents.username ?? '[]' }}
          </div>
          <div
            style="background-color: rgb(42, 178, 139);width: 10%; height: 40px; text-align: center; line-height: 40px; color:#fff; border-right: 2px solid #09a578; border-bottom: 2px solid #09a578;">
            性别
          </div>
          <div
            style="width: 15%; height: 40px; text-align: center;line-height: 40px;border-right: 2px solid #09a578; border-bottom: 2px solid #09a578;">
            {{ contents.sex == 1 ? '女' : '男' ?? '[]' }}
          </div>
          <div
            style="background-color: rgb(42, 178, 139); width: 10%; height: 40px; text-align: center; line-height: 40px; color:#fff; border-right: 2px solid #09a578; border-bottom: 2px solid #09a578;">
            出生日期
          </div>
          <div
            style="width: 15%;height: 40px;text-align: center;line-height: 40px;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            {{ birth ?? '[]' }}
          </div>
          <div
            style=" background-color: rgb(42, 178, 139); width: 10%; height: 40px; text-align: center; line-height: 40px;color:#fff; border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            年龄
          </div>
          <div style="width: 15%;height: 40px;text-align: center;line-height: 40px;border-bottom: 2px solid #09a578;">
            {{ births }}
          </div>
        </div>
        <div style="display: flex">
          <div
            style="background-color: rgb(42, 178, 139); width: 10%;height: 40px;text-align: center;line-height: 40px;color: #fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            身高
          </div>
          <div
            style="width: 15%;height: 40px;text-align: center;line-height: 40px;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            {{ contents.height ? contents.height + 'CM' : '' }}
          </div>
          <div
            style="background-color: rgb(42, 178, 139);width: 10%; height: 40px; text-align: center; line-height: 40px; color:#fff; border-right: 2px solid #09a578; border-bottom: 2px solid #09a578;">
            体重
          </div>
          <div
            style="width: 15%; height: 40px; text-align: center;line-height: 40px;border-right: 2px solid #09a578; border-bottom: 2px solid #09a578;">
            {{ contents.weight ? contents.weight + 'KG' : '' }}
          </div>
          <div
            style="background-color: rgb(42, 178, 139); width: 10%; height: 40px; text-align: center; line-height: 40px; color:#fff; border-right: 2px solid #09a578; border-bottom: 2px solid #09a578;">
            监护人姓名
          </div>
          <div
            style="width: 15%;height: 40px;text-align: center;line-height: 40px;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            {{ contents.guardian_name ?? '[]' }}
          </div>
          <div
            style=" background-color: rgb(42, 178, 139); width: 10%; height: 40px; text-align: center; line-height: 40px;color:#fff; border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            监护人手机号
          </div>
          <div style="width: 15%;height: 40px;text-align: center;line-height: 40px;border-bottom: 2px solid #09a578;">
            {{ contents.guardian_mobile ?? '[]' }}
          </div>
        </div>
        <div style="display: flex">
          <div
            style="background-color: #2AB28B; width: 9.9%;height: 40px;text-align: center;line-height: 40px;color: #fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            检测日期</div>
          <div style="width: 40%; height: 40px; border-bottom: 2px solid #09a578; line-height: 40px; text-indent: 20px;border-right: 2px solid #09a578;">
            {{ report_time }}
          </div>
          <div
            style="background-color: #2AB28B; width: 9.9%;height: 40px;text-align: center;line-height: 40px;color: #fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            BMI</div>
          <div style="width: 40%; height: 40px; border-bottom: 2px solid #09a578; line-height: 40px; text-indent: 20px;">
            {{ BMIs }}
          </div>
        </div>
      </div>
      <div style="width: 1070px; border-top: 2px solid #09a578; border-right: 2px solid #09a578;  margin-top: 10px"
        v-if="times == 1">
        <div style="display: flex">
          <div
            style="background-color: #2AB28B; width: 9.9%;height: 40px;text-align: center;line-height: 40px;color: #fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            检测日期</div>
          <div style="width: 90%; height: 40px; border-bottom: 2px solid #09a578; line-height: 40px; text-indent: 20px;">
            {{ report_time }}
          </div>
        </div>
        <div style="display: flex">
          <div
            style="background-color: rgb(42, 178, 139); width: 10%;height: 40px;text-align: center;line-height: 40px;color: #fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            儿童姓名
          </div>
          <div
            style="width: 15%;height: 40px;text-align: center;line-height: 40px;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            {{ contents.username ?? '[]' }}
          </div>
          <div
            style="background-color: rgb(42, 178, 139);width: 10%; height: 40px; text-align: center; line-height: 40px; color:#fff; border-right: 2px solid #09a578; border-bottom: 2px solid #09a578;">
            性别
          </div>
          <div
            style="width: 15%; height: 40px; text-align: center;line-height: 40px;border-right: 2px solid #09a578; border-bottom: 2px solid #09a578;">
            {{ contents.sex == 1 ? '女' : '男' ?? '[]' }}
          </div>
          <div
            style="background-color: rgb(42, 178, 139); width: 10%; height: 40px; text-align: center; line-height: 40px; color:#fff; border-right: 2px solid #09a578; border-bottom: 2px solid #09a578;">
            出生日期
          </div>
          <div
            style="width: 15%;height: 40px;text-align: center;line-height: 40px;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            {{ birth ?? '[]' }}
          </div>
          <div
            style=" background-color: rgb(42, 178, 139); width: 10%; height: 40px; text-align: center; line-height: 40px;color:#fff; border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            监护人姓名
          </div>
          <div style="width: 15%;height: 40px;text-align: center;line-height: 40px;border-bottom: 2px solid #09a578;">
            {{ contents.guardian_name ?? '[]' }}
          </div>
        </div>
        <div style="display: flex">
          <div
            style="background-color: rgb(42, 178, 139);width: 10%;height: 40px;text-align: center; line-height: 40px;color:#fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            监护人手机号
          </div>
          <div
            style=" width: 15%; height: 40px; text-align: center; line-height: 40px; border-right: 2px solid #09a578; border-bottom: 2px solid #09a578; ">
            {{ contents.guardian_mobile ?? '[]' }}
          </div>
          <div
            style="background-color: rgb(42, 178, 139);width: 10%;height: 40px;text-align: center; line-height: 40px;color:#fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            身高
          </div>
          <div
            style=" width: 15%; height: 40px; text-align: center; line-height: 40px; border-right: 2px solid #09a578; border-bottom: 2px solid #09a578; ">
            {{ contents.height ? contents.height + 'CM' : '' }}
          </div>
          <div
            style="background-color: rgb(42, 178, 139);width: 10%;height: 40px;text-align: center; line-height: 40px;color:#fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            体重
          </div>
          <div
            style=" width: 15%; height: 40px; text-align: center; line-height: 40px; border-right: 2px solid #09a578; border-bottom: 2px solid #09a578; ">
            {{ contents.weight ? contents.weight + 'KG' : '' }}
          </div>
          <div
            style="background-color: rgb(42, 178, 139);width: 10%;height: 40px;text-align: center; line-height: 40px;color:#fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            头围
          </div>
          <div style="width: 15%;height: 40px;text-align: center;line-height: 40px;border-bottom: 2px solid #09a578;">
            {{ contents.touwei ? contents.touwei + 'CM' : '' }}
          </div>
        </div>
        <div style="display: flex">
          <div
            style="background-color: rgb(42, 178, 139);width: 10%;height: 40px;text-align: center; line-height: 40px;color:#fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            出生身长
          </div>
          <div
            style=" width: 15%; height: 40px; text-align: center; line-height: 40px; border-right: 2px solid #09a578; border-bottom: 2px solid #09a578; ">
            {{ contents.chushengsg ? contents.chushengsg + 'CM' : '' }}
          </div>
          <div
            style="background-color: rgb(42, 178, 139);width: 10%;height: 40px;text-align: center; line-height: 40px;color:#fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            出生体重
          </div>
          <div
            style=" width: 15%; height: 40px; text-align: center; line-height: 40px; border-right: 2px solid #09a578; border-bottom: 2px solid #09a578; ">
            {{ contents.chushengtz ? contents.chushengtz + 'KG' : '' }}
          </div>
          <div
            style="background-color: rgb(42, 178, 139);width: 10%;height: 40px;text-align: center; line-height: 40px;color:#fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            腹围
          </div>
          <div
            style=" width: 15%; height: 40px; text-align: center; line-height: 40px; border-right: 2px solid #09a578; border-bottom: 2px solid #09a578; ">
            {{ contents.fuwei ? contents.fuwei + 'CM' : '' }}
          </div>
          <div
            style="background-color: rgb(42, 178, 139);width: 10%;height: 40px;text-align: center; line-height: 40px;color:#fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            血型
          </div>
          <div style="width: 15%;height: 40px;text-align: center;line-height: 40px;border-bottom: 2px solid #09a578;">
            {{ contents.xuexing_value ? contents.xuexing_value : '' }}
          </div>
        </div>
        <div style="display: flex">
          <div
            style="background-color: rgb(42, 178, 139);width: 10%;height: 40px;text-align: center; line-height: 40px;color:#fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            民族
          </div>
          <div
            style=" width: 15%; height: 40px; text-align: center; line-height: 40px; border-right: 2px solid #09a578; border-bottom: 2px solid #09a578; ">
            {{ contents.minzu_value ? contents.minzu_value : '' }}
          </div>
          <div
            style="background-color: rgb(42, 178, 139);width: 10%;height: 40px;text-align: center; line-height: 40px;color:#fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            与监护人关系
          </div>
          <div
            style=" width: 15%; height: 40px; text-align: center; line-height: 40px; border-right: 2px solid #09a578; border-bottom: 2px solid #09a578; ">
            {{ contents.guanxi_value ? contents.guanxi_value : '' }}
          </div>
          <div
            style="background-color: rgb(42, 178, 139);width: 10%;height: 40px;text-align: center; line-height: 40px;color:#fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            家长受教育程度
          </div>
          <div
            style=" width: 15%; height: 40px; text-align: center; line-height: 40px; border-right: 2px solid #09a578; border-bottom: 2px solid #09a578; ">
            {{ contents.jiaoyu_value ? contents.jiaoyu_value : '' }}
          </div>
          <div
            style="background-color: rgb(42, 178, 139);width: 10%;height: 40px;text-align: center; line-height: 40px;color:#fff;border-right: 2px solid #09a578;border-bottom: 2px solid #09a578;">
            出生情况
          </div>
          <div style="width: 15%;height: 40px;text-align: center;line-height: 40px;border-bottom: 2px solid #09a578;">
            {{ contents.birthSituation_value ? contents.birthSituation_value : '' }}
          </div>
        </div>
      </div>
      <div style="width: 100%;height: 40px;background-color: rgb(42, 178, 139);margin-top:10px;display: flex;">
        <div><img src="../../assets/img/13.jpg" style="height: 40px" alt="" /></div>
        <div style="font-size: 20px;margin-left: 10px;line-height: 40px;color:#fff;">
          体成分数据分析
        </div>
      </div>
      <ChildViewprint></ChildViewprint>

      
    </div>
  </div>
</template>
    
<script setup>
import ChildViewprint from '../common/ChildViewPrints.vue';
import { defineComponent, onMounted, ref, watch, reactive } from 'vue'
import { ElMessage } from "element-plus";
import http from "../../utils/http";
import { useRoute, useRouter } from "vue-router"
const route = useRoute()
const router = useRouter()
const labName = ref()
const groupId = ref()
const id = ref()
const reportId = ref()
const births=ref();
const username = ref()
const guardian = ref()
const birthStatus = ref()
const contents = ref({})
const onBmishow = ref(1)
const birth = ref()
const info = ref({});
const fatHigh = ref(false)
const fatNormal = ref(false)
const fatLow = ref(false)
const WaistHigh = ref(false)
const WaistNormal = ref(false)
const times = ref()
const WaistLow = ref(false)
const EdemaHigh = ref(false)
const EdemaNormal = ref(false)
const EdemaLow = ref(false)
const proteinHigh = ref(false)
const proteinNormal = ref(false)
const proteinLow = ref(false)
const FatHigh = ref(false)
const FatNormal = ref(false)
const FatLow = ref(false)
const FatHighNormal = ref(true)
const hospital_name = ref()
const report_time = ref()
const Titlename = ref()
const BMIs=ref();

import PrintJS from 'print-js'

const onHome = async () => {
  await router.push({ 'path': '/Home' })
}

const fetchData = async () => {
  Titlename.value = localStorage.getItem('Title');
  if (route.params.groupId) {
    groupId.value = route.params.groupId
    id.value = route.params.id
    reportId.value = route.params.reportId

    username.value = route.params.username
    guardian.value = route.params.guardian
    birthStatus.value = route.params.birth
    if (groupId.value === 3) {
      labName.value = '婴幼儿营养测评'
    } else if (groupId.value === 5) {
      labName.value = '孕产妇营养测评'
    } else if (groupId.value === 6) {
      labName.value = '成年人营养测评'
    } else if (groupId.value === 7) {
      labName.value = '慢性病营养测评'
    } else {
      labName.value = '婴幼儿营养测评'
    }
    //获取用户年龄
    http.get("api/archives/evaluating?id=" + id.value ).then((res) => {
      births.value=res.data.data.birth;
    });

    http.get('api/archives/viewreport?id=' + reportId.value + '&username=' + username.value + '&guardian=' + guardian.value + '&birth=' + birthStatus.value).then((res) => {
      hospital_name.value = res.data.data.hospital_name
      report_time.value = res.data.data.createtime;
      contents.value = res.data.data.contents;
      birth.value = res.data.data.contents.birth;
    })

    http.get('api/archives/viewReportMember?id=' + reportId.value + '&username=' + username.value + '&guardian=' + guardian.value + '&birth=' + birthStatus.value).then((res) => {
      if (res.data.data.times) {
        let parsedDate = new Date(res.data.data.times);
        let targetDateObj = new Date('2024-01-08');
        if (parsedDate < targetDateObj) {
          times.value = 1;
        } else if (parsedDate > targetDateObj) {
          times.value = 2;
        }
      }

      if (res.data.code === 0) {
        ElMessage.error(res.data.msg)
      }
      BMIs.value=res.data.data.bmi;
      report_time.value = res.data.data.times
      contents.value = res.data.data.contents;

    })

    http.get('api/report/getreport?id=' + id.value + '&reportId=' + reportId.value + '&username=' + username.value + '&guardian=' + guardian.value + '&birth=' + birthStatus.value).then((res) => {
      if (res.data.code === 0) {
        ElMessage.error(res.data.msg)
      }


      let data = res.data.data.component;
      info.value.Fat = data.Fat;
      info.value.FatMin = data.FatMin;
      info.value.FatMax = data.FatMax;

      info.value.Bone = data.Bone;
      info.value.BoneMin = data.BoneMin;
      info.value.BoneMax = data.BoneMax;

      info.value.Protein = data.Protein;
      info.value.ProteinMin = data.ProteinMin;
      info.value.ProteinMax = data.ProteinMax;

      info.value.Water = data.Water;
      info.value.WaterMin = data.WaterMin;
      info.value.WaterMax = data.WaterMax;

      info.value.Weight = data.Weight;
      info.value.WeightMin = data.WeightMin;
      info.value.WeightMax = data.WeightMax;

      info.value.LBM = data.LBM;
      info.value.LBMMin = data.LBMMin;
      info.value.LBMMax = data.LBMMax;

      info.value.Muscle = data.Muscle;
      info.value.MuscleMin = data.MuscleMin;
      info.value.MuscleMax = data.MuscleMax;

      info.value.ICW = data.ICW;
      info.value.ICWMin = data.ICWMin;
      info.value.ICWMax = data.ICWMax;

      info.value.PBF = data.PBF;
      info.value.PBFMin = data.PBFMin;
      info.value.PBFMax = data.PBFMax;

      info.value.SMM = data.SMM;
      info.value.SMMMin = data.SMMMin;
      info.value.SMMMax = data.SMMMax;

      info.value.BMI = data.BMI;
      info.value.BMIMin = data.BMIMin;
      info.value.BMIMax = data.BMIMax;

      info.value.WHR = data.WHR;
      info.value.WHRMin = data.WHRMin;
      info.value.WHRMax = data.WHRMax;

      info.value.Weight_control = data.Weight_control;
      info.value.Fat_control = data.Fat_control;
      info.value.Muscle_control = data.Muscle_control;
      // 内脏指数
      info.value.VFI = data.VFI;
      info.value.VFIMin = data.VFIMin;
      info.value.VFIMax = data.VFIMax;
      // 水中系数
      info.value.Edema = data.Edema;
      info.value.EdemaMin = data.EdemaMin;
      info.value.EdemaMax = data.EdemaMax;
      // 细胞外液
      info.value.ECW = data.ECW;
      // 基础代谢
      info.value.BMR = data.BMR;
      // 身体水分率
      // info.value.Water = (data.Water * 100).toFixed(2);
      if (data.PBF < data.PBFMin) {
        fatHigh.value = true;
      } else if (data.PBF >= data.PBFMin && data.PBF <= data.PBFMax) {
        fatNormal.value = true;
      } else if (data.PBF > data.PBFMax) {
        fatLow.value = true;
      }

      if (data.WHR < data.WHRMin) {
        WaistHigh.value = true;
      } else if (data.WHR >= data.WHRMin && data.WHR <= data.WHRMax) {
        WaistNormal.value = true;
      } else if (data.WHR > data.WHRMax) {
        WaistLow.value = true;
      }
      // 水肿指标
      if (data.Edema < data.EdemaMin) {
        EdemaHigh.value = true;
      } else if (data.Edema >= data.EdemaMin && data.Edema <= data.EdemaMax) {
        EdemaNormal.value = true;
      } else if (data.Edema > data.EdemaMax) {
        EdemaLow.value = true;
      }
      // 蛋白质
      if (data.Protein < data.ProteinMin) {
        proteinHigh.value = true;
      } else if (data.Protein >= data.ProteinMin && data.Protein <= data.ProteinMax) {
        proteinNormal.value = true;
      } else if (data.Protein > data.ProteinMax) {
        proteinLow.value = true;
      }
      //脂肪
      if (data.Fat < data.FatMin) {
        FatHigh.value = true;
      } else if (data.Fat >= data.FatMin && data.Protein <= data.FatMax) {
        FatNormal.value = true;
      } else if (data.Fat > data.FatMax) {
        FatLow.value = true;
      }

      // 处理指标参数
      info.value.Weightkeyword = '✔ 正常';
      info.value.Weightcolor = 'everyBlack';
      if (data.Weight < data.WeightMin) {
        info.value.Weightkeyword = '▼ 不足';
        info.value.Weightcolor = 'everyRed';
      } else if (data.Weight > data.WeightMax) {
        info.value.Weightkeyword = '▲ 超标';
        info.value.Weightcolor = 'everyOrange';
      }

      info.value.Musclekeyword = '✔ 正常';
      info.value.Musclecolor = 'everyBlack';
      if (data.Muscle < data.MuscleMin) {
        info.value.Musclekeyword = '▼ 不足';
        info.value.Musclecolor = 'everyRed';
      } else if (data.Muscle > data.MuscleMax) {
        info.value.Musclekeyword = '▲ 超标';
        info.value.Musclecolor = 'everyOrange';
      }

      info.value.PBFkeyword = '✔ 正常';
      info.value.PBFcolor = 'everyBlack';
      if (data.PBF < data.PBFMin) {
        info.value.PBFkeyword = '▼ 不足';
        info.value.PBFcolor = 'everyRed';
      } else if (data.PBF > data.PBFMax) {
        info.value.PBFkeyword = '▲ 超标';
        info.value.PBFcolor = 'everyOrange';
      }

      info.value.Bonekeyword = '✔ 正常';
      info.value.Bonecolor = 'everyBlack';
      if (data.Bone < data.BoneMin) {
        info.value.Bonekeyword = '▼ 不足';
        info.value.Bonecolor = 'everyRed';
      } else if (data.Bone > data.BoneMax) {
        info.value.Bonekeyword = '▲ 超标';
        info.value.Bonecolor = 'everyOrange';
      }

      info.value.Waterkeyword = '✔ 正常';
      info.value.Watercolor = 'everyBlack';
      if (data.Water < data.WaterMin) {
        info.value.Waterkeyword = '▼ 不足';
        info.value.Watercolor = 'everyRed';
      } else if (data.Water > data.WaterMax) {
        info.value.Waterkeyword = '▲ 超标';
        info.value.Watercolor = 'everyOrange';
      }

      info.value.SMMkeyword = '✔ 正常';
      info.value.SMMcolor = 'everyBlack';
      if (data.SMM < data.SMMMin) {
        info.value.SMMkeyword = '▼ 不足';
        info.value.SMMcolor = 'everyRed';
      } else if (data.SMM > data.SMMMax) {
        info.value.SMMkeyword = '▲ 超标';
        info.value.SMMcolor = 'everyOrange';
      }

      info.value.BMIkeyword = '✔ 正常';
      info.value.BMIcolor = 'everyBlack';
      if (data.BMI < data.BMIMin) {
        info.value.BMIkeyword = '▼ 不足';
        info.value.BMIcolor = 'everyRed';
      } else if (data.BMI > data.BMIMax) {
        info.value.BMIkeyword = '▲ 超标';
        info.value.BMIcolor = 'everyOrange';
      }

      info.value.WHRkeyword = '✔ 正常';
      info.value.WHRcolor = 'everyBlack';
      if (data.WHR < data.WHRMin) {
        info.value.WHRkeyword = '▼ 不足';
        info.value.WHRcolor = 'everyRed';
      } else if (data.WHR > data.WHRMax) {
        info.value.WHRkeyword = '▲ 超标';
        info.value.WHRcolor = 'everyOrange';
      }



    })
    setTimeout(() => {
      print('print-all')
    }, 2000)
  } else {
    ElMessage.error('栏目编号不得为空')
    await router.push({ 'path': '/Home' })
  }
}

onMounted(() => {
  fetchData()
})
</script>
    
<style scoped>
.right-box-card {
  margin-left: 0%;
  margin-top: 0%;
  position: static;
  top: calc(0px);
  width: 100%;

}

#basic .title {
  font-size: 36px;
  width: 100%;
  text-align: center;
}

#basic #createTime {
  font-size: 16px;
  color: #999999;
  float: right;
}

.params {
  width: 100%;
  font-size: 22px;
  font-weight: bold;
}

.shu {
  width: 5px;
  height: 30px;
  background: #2AB28B;
  opacity: 1;
  border-radius: 100px;
  float: left;
  margin-right: 2%;
  margin-left: 3%;
}

#analMan {
  margin-top: 2%;
  text-align: center;
  color: #fff;
  width: 60%;
  float: left;

}

#analMan #imgMan {
  float: left;
}

#analMan #imgFat {
  margin-left: 33%;
  width: 269px;
  height: 35px;
  line-height: 35px;
  background: #E88F73;
  opacity: 1;
}

#analMan #imgBone {
  margin-left: 33%;
  width: 269px;
  height: 53px;
  line-height: 53px;
  background: #B1D964;
  opacity: 1;
}

#analMan #imgProtein {
  margin-left: 33%;
  width: 269px;
  height: 53px;
  line-height: 53px;
  background: #E8BA73;
  opacity: 1;
}

#analMan #imgWater {
  margin-left: 33%;
  width: 269px;
  height: 193px;
  line-height: 193px;
  background: #6BA9E4;
  opacity: 1;
}

#right_1 {
  float: left;
  background: url('../../assets/img/analysis_man_right_1.png');
  width: 269px;
  height: 327px;
  margin-top: 26px;
  color: #fff;
  text-align: right;
  font-size: 12px;
}

#right_2 {
  float: left;
  background: url('../../assets/img/analysis_man_right_2.png');
  width: 268px;
  height: 294px;
  margin-top: 16px;
  color: #fff;
  text-align: right;
}

#right_3 {
  float: left;
  background: url('../../assets/img/analysis_man_right_3.png');
  width: 206px;
  height: 247px;
  margin-top: 30px;
  color: #fff;
  text-align: right;
}

#right_4 {
  float: left;
  background: url('../../assets/img/analysis_man_right_4.png');
  width: 160px;
  height: 196px;
  margin-top: 36px;
  color: #fff;
}

#right_5 {
  float: left;
  background: url('../../assets/img/analysis_man_right_5.png');
  width: 86px;
  height: 75px;
  margin-top: 105px;
  color: #fff;
}

.right_content {
  text-align: right;
  padding-right: 7px;
  padding-top: 20px;
}

#basic {
  font-size: 16px;
  width: 1075px;
  min-height: 1244px;
  overflow: hidden;
  padding: 0;
  word-break: break-all;
  /*margin: 60px auto 0 auto;*/
  box-shadow: var(--el-box-shadow-light);
  border-radius: var(--el-card-border-radius);
  background-color: var(--el-card-bg-color);
  /* color: var(--el-text-color-primary); */
  transition: var(--el-transition-duration);
  --el-card-border-color: var(--el-border-color-light, #ebeef5);
  --el-card-border-radius: 4px;
  --el-card-padding: 20px;
  --el-card-bg-color: var(--el-color-white);
}

.Basic {
  margin-top: 20px;
}

#BasicAssessment {}

#BasicAssessment .bt {
  background: #F7F7F7;
  color: #fff;
}

#BasicAssessment .bt span {
  width: 25%;
  float: left;
  text-align: center;
  color: #999999;
  line-height: 30px;
}

#BasicAssessment ul li {
  width: 100%;
  display: inline-block;
  margin: 0;
}

#BasicAssessment .element span {
  width: 25%;
  float: left;
  text-align: center;
  line-height: 60px;
}

#WeightAssessment {
  width: 30%;
}

#Obesity {
  background: url('../../assets/img/analysis_man_right_round.png');
  width: 122px;
  height: 122px;
  color: #fff;
  font-size: 12px;
  margin-left: 10%;

}

#ObesityContent {
  margin-left: 50%;
}

#ObesityRight {
  float: left;
  width: 35%;
  margin-left: 5%;
}

#ObesityRight ul li {
  border: 1px solid #eee;
  width: 310px;
  height: 55px;
  font-size: 18px;
  color: #999999;
  background: #F7F7F7;
  line-height: 55px;
  list-style-type: none;
  text-align: right;
  margin-left: -30px;
}

#ObesityRight ul .weight_run {}

#ObesityRight ul li .weight_param {
  color: #333333;
  padding-right: 30%;
}

#Obesity #ObesityFat {
  float: left;
  margin-top: 45%;
  margin-left: 20%;
}

#Obesity #ObesityProtein {
  margin-top: 25%;
  margin-left: 60%;
}

.analysis_waist {
  float: left;
  width: 33%;
}

.fen {
  width: 129%;
  height: 30px;
  box-sizing: border-box;
  margin-top: 30px;
  margin-left: -15%;
}

.fenss {
  text-align: center;
}

#viscus {
  margin-top: 9px;
  margin-left: 5.5%;
  color: #333333;
  font-size: 18px;
  width: 100%;
}

.ViscusNumber {
  font-size: 50px;
  color: #E8B973;
}

.ViscusType {
  font-size: 16px;
  color: #fff;
  width: 100px;
  height: 68px;
  border-radius: 30px;
  background: #E8B973;
  padding: 0 20px;
  margin-left: 20px;
}

.ViscusNormal {
  font-size: 16px;
  color: #fff;
  width: 100px;
  height: 68px;
  border-radius: 30px;
  background: green;
  padding: 0 20px;
  margin-left: 20px;
}

.ViscusLow {
  font-size: 16px;
  color: #fff;
  width: 100px;
  height: 68px;
  border-radius: 30px;
  background: red;
  padding: 0 20px;
  margin-left: 20px;
}

.fen .fenssNumber {
  width: 100%;
}

.fen .fenssNumber .six {
  width: 2%;
  text-align: left;
  color: #999999;
  font-size: 14px;
}

.fen .fenssNumber span {
  width: 32.33%;
  float: left;
  text-align: right;
  color: #999999;
  font-size: 14px;
}

.Intracellular {
  position: absolute;
  margin-top: 40px;
  margin-left: 80px;
  width: 55px;
  height: 59px;
  font-size: 12px;
  color: #fff;
  -moz-transform: rotate(-70deg);
  -webkit-transform: rotate(-70deg);
  display: block;
  filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3)
}

.ECF {
  position: absolute;
  margin-top: 17px;
  margin-left: 179px;
  width: 55px;
  height: 59px;
  font-size: 12px;
  color: #fff;
  -moz-transform: rotate(30deg);
  -webkit-transform: rotate(30deg);
  display: block;
  filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3)
}

.other {
  position: absolute;
  margin-top: 160px;
  margin-left: 209px;
  width: 55px;
  height: 59px;
  font-size: 12px;
  color: #fff;
  -moz-transform: rotate(-40deg);
  -webkit-transform: rotate(-40deg);
  display: block;
  filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3)
}

.BodyMoisture {
  position: absolute;
  margin-top: 80px;
  margin-left: 140px;
  color: #999999;
  font-size: 12px;
}

.BodyMoisture span {
  font-size: 18px;
  font-weight: bold;
  color: #333333;
}

#edema {
  padding-top: 5%;
  margin-left: 40%;
  font-size: 18px;
  color: #666666;
}

#edema span {
  font-size: 50px;
}

#edemaType {
  margin-left: 40%;
  width: 500px;
  background: red;
}

#edemaType span {
  text-align: center;
  float: left;
  width: 120px;
}

#Nutritional {
  margin-left: 6%;
}

#Nutritional span {
  font-size: 25px;
  color: #2AB28B;
}

.everyRed {
  color: red;
}

.everyOrange {
  color: orange;
}

.everyBlack {
  color: #333333;
}
</style>
    